home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amiga Magazin: Amiga-CD 1997 November & December
/
Amiga-CD 1997 #11-12.iso
/
pd-disketten
/
dms-gepackt
/
9_95
/
apd-9-95-2.dms
/
apd-9-95-2.adf
/
Tips&Tricks
/
VieleFenster.c
< prev
next >
Wrap
C/C++ Source or Header
|
1995-08-22
|
642b
|
34 lines
static int ct = 0;
ULONG sig_in;
struct Window *OpenMWindow(struct TagItem *wintags,
struct MsgPort *userport,ULONG idcmps)
{
struct Window *win=0l;
if(win=OpenWindowTagList(0l,wintags))
{
win->UserPort=userport;
ModifyIDCMP(win,idcmps);
ct++;
sig_in|=(1L<<userport->mp_SigBit);
}
return(win);
}
void CloseMWindow(struct Window *win)
{
struct IntuiMessage *imsg;
if(win)
{
ct--;
if(!(ct)) sig_in&=~(1L<<win->UserPort->mp_SigBit);
Forbid();
while(imsg=GetMsg(win->UserPort)) ReplyMsg(imsg);
win->UserPort=0l;ModifyIDCMP(win,0l);
Permit();
CloseWindow(win);
}
}